package controlPlane;

import java.util.HashMap;
import java.util.Map;

import multidomain.TED;
import tracing.Tracer;
import wdmsim.Constants;
import wdmsim.EventScheduler;
import wdmsim.Flow;
import wdmsim.Node;
import wdmsim.Path;
import wdmsim.PhysicalTopology;
import events.CrankbackEvent;
import events.Event;
import events.RouteRequestEvent;
import events.UpdateEvent;

/**
 * crankback = true;
 * wavelengthConversion = false;
 * multiHop = false;
 * grooming = true || false; // to false, put traffic.bw = link.bw
 * multipath = false;
 * wavelengthDecision = destination;
 * 
 * @author Alisson
 *
 */
public class PCE2 extends Node implements MultidomainControlPlane {

	/** */
	Tracer trace = Tracer.getTracerObject();
	/** */
	EventScheduler scheduler = EventScheduler.getInstance();
	/** */
	PhysicalTopology pt = PhysicalTopology.getInstance();
	/** Flows that have been accepted or that are waiting for a decision */
	private Map<Long, Flow> mappedFlows;
	/** Flows that have been accepted into the network */
    private Map<Flow, Path> activeFlows;
    /** */
	private TED ted;
	
	public PCE2(int id) throws Exception {
		this.id = id;
		this.ted = new TED(id);
		generateUpdateEvent();
		mappedFlows = new HashMap<Long, Flow>();
        activeFlows = new HashMap<Flow, Path>();
	}
	
	@Override
	public void handle(Event event) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void handleRouteRequestEvent(RouteRequestEvent event)
			throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void handleAbortEvent(Event event) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void handleCrankbackEvent(CrankbackEvent event) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void generateRouteRequestEvent(Event event) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void generateAbortEvent(Event event) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void generateCrankbackEvent(RouteRequestEvent event) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void generateRouteReply(Event event) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void createMultidomainLightpath(Flow flow) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void generateDestroyLightpathEvent(Flow flow) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void handleRouteReply(Event event) {
		// TODO Auto-generated method stub
		
	}

	/**
	 * 
	 */
	private void generateUpdateEvent() {
		//UpdateEvent updateEvent = new UpdateEvent(this);
		//scheduler.schedule(updateEvent, (long)(Math.random()*Constants.UPDATE_TIME));
	}
}
